<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of rbfsetfw</title>
  <meta name="keywords" content="rbfsetfw">
  <meta name="description" content="RBFSETFW Set basis function widths of RBF.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../menu.html">Home</a> &gt;  <a href="#">ReBEL-0.2.7</a> &gt; <a href="#">netlab</a> &gt; rbfsetfw.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../menu.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="menu.html">Index for .\ReBEL-0.2.7\netlab&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>rbfsetfw
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>RBFSETFW Set basis function widths of RBF.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function net = rbfsetfw(net, scale) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">RBFSETFW Set basis function widths of RBF.

    Description
    NET = RBFSETFW(NET, SCALE) sets the widths of the basis functions of
    the RBF network NET. If Gaussian basis functions are used, then the
    variances are set to the largest squared distance between centres if
    SCALE is non-positive and SCALE times the mean distance of each
    centre to its nearest neighbour if SCALE is positive.  Non-Gaussian
    basis functions do not have a width.

    See also
    <a href="rbftrain.html" class="code" title="function [net, options] = rbftrain(net, options, x, t)">RBFTRAIN</a>, <a href="rbfsetbf.html" class="code" title="function net = rbfsetbf(net, options, x)">RBFSETBF</a>, <a href="gmmem.html" class="code" title="function [mix, options, errlog] = gmmem(mix, x, options)">GMMEM</a></pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="dist2.html" class="code" title="function n2 = dist2(x, c)">dist2</a>	DIST2	Calculates squared distance between two sets of points.</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="gtminit.html" class="code" title="function net = gtminit(net, options, data, samp_type, varargin)">gtminit</a>	GTMINIT Initialise the weights and latent sample in a GTM.</li><li><a href="rbfsetbf.html" class="code" title="function net = rbfsetbf(net, options, x)">rbfsetbf</a>	RBFSETBF Set basis functions of RBF from data.</li></ul>
<!-- crossreference -->


<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function net = rbfsetfw(net, scale)</a>
0002 <span class="comment">%RBFSETFW Set basis function widths of RBF.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">%    Description</span>
0005 <span class="comment">%    NET = RBFSETFW(NET, SCALE) sets the widths of the basis functions of</span>
0006 <span class="comment">%    the RBF network NET. If Gaussian basis functions are used, then the</span>
0007 <span class="comment">%    variances are set to the largest squared distance between centres if</span>
0008 <span class="comment">%    SCALE is non-positive and SCALE times the mean distance of each</span>
0009 <span class="comment">%    centre to its nearest neighbour if SCALE is positive.  Non-Gaussian</span>
0010 <span class="comment">%    basis functions do not have a width.</span>
0011 <span class="comment">%</span>
0012 <span class="comment">%    See also</span>
0013 <span class="comment">%    RBFTRAIN, RBFSETBF, GMMEM</span>
0014 <span class="comment">%</span>
0015 
0016 <span class="comment">%    Copyright (c) Ian T Nabney (1996-2001)</span>
0017 
0018 <span class="comment">% Set the variances to be the largest squared distance between centres</span>
0019 <span class="keyword">if</span> strcmp(net.actfn, <span class="string">'gaussian'</span>)
0020    cdist = <a href="dist2.html" class="code" title="function n2 = dist2(x, c)">dist2</a>(net.c, net.c);
0021    <span class="keyword">if</span> scale &gt; 0.0
0022       <span class="comment">% Set variance of basis to be scale times average</span>
0023       <span class="comment">% distance to nearest neighbour</span>
0024       cdist = cdist + realmax*eye(net.nhidden);
0025       widths = scale*mean(min(cdist));
0026    <span class="keyword">else</span>
0027       widths = max(max(cdist));
0028    <span class="keyword">end</span>
0029    net.wi = widths * ones(size(net.wi));
0030 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Tue 26-Sep-2006 10:36:21 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
</body>
</html>